package com.woody.aggregate.msgsendrule.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Optional;

/**
 * &copy; All rights Reserved
 *
 * @author wénkǎi.zhāng 2025-03-18
 */
@Getter
@RequiredArgsConstructor
public enum MsgSendUserTypeEnum {
    SHOP(1, "店铺");

    /**
     * 用户类型
     */
    private final Integer type;

    /**
     * 类型描述
     */
    private final String desc;

    public static Optional<MsgSendUserTypeEnum> getByType(Integer type) {
        for (MsgSendUserTypeEnum value : values()) {
            if (value.getType().equals(type)) {
                return Optional.of(value);
            }
        }

        return Optional.empty();
    }

}
